package com.mini.cn.goods.dao.impl;

import com.mini.cn.goods.dao.BaseDao;
import com.mini.cn.goods.dao.IAddDicDao;
import com.mini.cn.goods.po.Adddic;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("AdddicDaoimpl")
public class AddDicDaoImpl extends BaseDao<Adddic> implements IAddDicDao {
    @Override
    public Adddic getAdddicByCode(String code) throws Exception {
        StringBuilder builder=new StringBuilder();
        builder.append("from Adddic addr where addr.cCode='"+code+"'");
        List<Adddic> adddics=find(builder.toString());
        if(adddics!=null&&adddics.size()>0){
            return adddics.get(0);
        }
        return null;
    }
}
